package com.ds.bintree.LeetCode;

/**
 * @author Dianzhi Han
 * @version 1.0
 * @description: TODO
 * @date 2022/9/7 23:43
 */
public class Num104_MaxDepth {
    public int maxDepth(TreeNode root) {
        if (root==null){
            return 0;
        }
        return 1+Math.max(maxDepth(root.left),maxDepth(root.right));
    }
}
